package com.ddyx.service.product.api.feign;

import com.ddyx.common.base.constant.ServiceNameConstants;
import com.ddyx.service.product.api.entity.Goods;
import com.ddyx.service.product.api.feign.fallback.RemoteProductClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * <p>
 *      商品远程调用接口
 * </p>
 * class: RemoteProductClient.java
 * author: agula
 * since: 2019-08-01  16:20
 */
@FeignClient(value = ServiceNameConstants.PRODUCT_SERVICE, fallback = RemoteProductClientFallback.class)
public interface RemoteProductClient {

    String API_PREFIX = "/product";

    /**
     * 获取商品信息
     *
     * @param productId 商品id
     * @return
     */
    @GetMapping(API_PREFIX + "/product-info-by-id")
    Goods ProductInfo(@PathVariable("productId") Integer productId);


}
